package bluerain.io.adapter.ui;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

import bluerain.io.adapter.R;

/**
 * Created by foredawn on 15-9-9.
 * 继承ListActivity实现Adapter填充默认List
 */
public class ListActivityTest extends ListActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_activity);
        ArrayAdapter<String> adapter =
                new ArrayAdapter<>(this, R.layout.array_item,
                        new String[]{"呵呵哒", "嘻嘻"});

        //默认填充ID为android:list的ListView
        setListAdapter(adapter);
    }
}
